﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="Iridescent.CourseHubPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait" Orientation="Portrait"
	shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="HeaderTemplate">
            <Grid Background="{StaticResource PhoneAccentBrush}"
                  Margin="0,0,0,12">
                <TextBlock Text="{Binding Key,Converter={StaticResource DayOfWeekConverter}}" Margin="{StaticResource PhoneTouchTargetOverhang}"
                           FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="CourseTemplate">
            <StackPanel Margin="12,0,0,12">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding StartTime,Converter={StaticResource TimeConverter}}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
                    <TextBlock Text="-" Margin="6,0"
                               FontSize="{StaticResource PhoneFontSizeMedium}"/>
                    <TextBlock Text="{Binding EndTime,Converter={StaticResource TimeConverter}}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
                </StackPanel>
                <TextBlock Text="{Binding Location}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <controls:Panorama  Title="{Binding CourseName}">

            <!--Panorama item one-->
            <controls:PanoramaItem Header="本周安排">
                <Grid>
                    <toolkit:LongListSelector ItemsSource="{Binding Arrangements}" GroupHeaderTemplate="{StaticResource HeaderTemplate}" GroupItemTemplate="{StaticResource HeaderTemplate}" ItemTemplate="{StaticResource CourseTemplate}"/>
                </Grid>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem Header="item2">
                <Grid/>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
</phone:PhoneApplicationPage>